package com.munoor.dalai.server.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;



/**
 * The persistent class for the USERS database table.
 * 
 */
@Entity
@Table(name="USERS")

@NamedQueries({
	@NamedQuery(name = "Users.getSingleEmailCount", query = "SELECT COUNT(u) FROM User u WHERE u.email = :email"),
	@NamedQuery(name = "Users.getSingleUsernameCount", query = "SELECT COUNT(u) FROM User u WHERE u.username = :username"),
	@NamedQuery(name = "Users.findByVerifyCode", query = "SELECT u FROM User u WHERE u.vCode = :vCode"),
	@NamedQuery(name = "Users.findByUsername", query = "SELECT u FROM User u WHERE u.username = :username")})
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="USER_ID")
	private Long userId;

	private String email;

	@Column(name="LAST_SCAN")
	private long lastScan;
	
	private long welcome;

	private String password;
	
	@Column(name="VERIFY_CODE")
	private String vCode;
	
	@Column(name="USER_TYPE")
	private short userType;
	// -1 Admin
	// 0 Content provider
	// 1 suscriber
	// 2 active non suscriber
	// 3 restricted non suscriber
	// 4 registered but unveried
	// 5 banned
	// frozen

	private String username;

    public User() {
    }

	public long getUserId() {
		return this.userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public long getLastScan() {
		return this.lastScan;
	}

	public void setLastScan(long lastScan) {
		this.lastScan = lastScan;
	}

	public long getWelcome() {
		return this.welcome;
	}

	public void setWelcome(long welcome) {
		this.welcome = welcome;
	}
	
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public short getUserType() {
		return this.userType;
	}

	public void setUserType(short userType) {
		this.userType = userType;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getvCode() {
		return vCode;
	}

	public void setvCode(String vCode) {
		this.vCode = vCode;
	}
}